package com.yc.springcloud.service;

import com.yc.springcloud.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author DELL
 * @Date 2024/11/20 20:42
 * @Version 1.0
 */

@FeignClient(value = "seata-storage-micor-server")
public interface StorageService {

	/**
	 * 老师解读
	 * 1. 远程调用方式是 post
	 * 2. 远程调用的url 为 http://seata_storage_micro_service/storage/reduce
	 * 3. seata_storage_micro_service是nacos注册中心服务名
	 * 4. openfeign是通过接口方式调用服务
	 */
	//扣减库存
	@PostMapping(value = "/storage/reduce")
	Result reduce(@RequestParam("productId") Long productId, @RequestParam("nums") Integer nums);
}
